package com.cgsd.heyu.ui.task.adapter;

import android.text.TextUtils;

import com.cgsd.heyu.R;
import com.cgsd.heyu.common.AvatarManger;
import com.cgsd.heyu.ui.task.vo.PublishDetailVo;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * Author: sky on 2021/3/23 16:17
 * Email: xcode126@126.com
 * Desc:
 */
public class PublishDetailAdapter extends BaseQuickAdapter<PublishDetailVo.DostepBean, BaseViewHolder> {

    public PublishDetailAdapter() {
        super(R.layout.item_publish_detail);
    }

    @Override
    protected void convert(BaseViewHolder helper,PublishDetailVo.DostepBean item) {
        helper.setText(R.id.tv_step, "" + item.step);
        helper.setText(R.id.tv_step_title, "步骤" + item.step);
        helper.setText(R.id.tv_title, TextUtils.isEmpty(item.title) ? "暂无描述标题" : item.title);
        AvatarManger.setAvatar(mContext, item.backiimage, helper.getView(R.id.iv_picture));
        helper.setText(R.id.tv_content, item.backcom);
        helper.setGone(R.id.iv_picture, !TextUtils.isEmpty(item.backiimage));
        helper.setGone(R.id.tv_content, !TextUtils.isEmpty(item.backcom));
        helper.addOnClickListener(R.id.iv_picture);
    }
}
